package cn.flying.cloud.gateway.loadbalancer;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import com.netflix.loadbalancer.IRule;

/**
 * @author: admin
 * @date: 2025年03月16日 11:21
 * @version: 1.0
 */
@Configuration
public class TrafficConfiguration {

    @Bean
    @ConditionalOnProperty(prefix = "spring.cloud.nacos.discovery.metadata", name = "env-id", havingValue = "dev")
    @Scope("prototype")
    public IRule iRule() {
        return new TrafficLoadBalancerRule();
    }
}